package pt.mauromad.guias.controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import pt.mauromad.guias.dao.AddressDao;

@Controller
@RequestMapping("/display")
public class DisplayController extends BaseController {
	@RequestMapping(value = "/address/{address:[0-9]+}")
	public String displayAddress(Model model, @PathVariable AddressDao address) {
		model.addAttribute("address", address);
		return "display/address-display";
	}

	@RequestMapping(value = "/address/{address:[0-9]+}/full")
	public String displayAddressFull(Model model, @PathVariable AddressDao address) {
		model.addAttribute("address", address);
		model.addAttribute("addressFull", true);
		return "display/address-display";
	}
}
